clang-tidy: check and fix cppcoreguidelines-avoid-c-arrays#3080
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review infoConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Pro 📒 Files selected for processing (2)
💤 Files with no reviewable changes (1)
WalkthroughThis change removes the Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/common/assert.cpp`:
- Around line 38-49: The get_backtrace() function currently passes a hardcoded
literal 16 to backtrace(), which defeats the std::array usage; change the call
to use trace.size() (or static_cast<int>(trace.size()) if needed) so
backtrace(trace.data(), /*size*/ ) uses the array's capacity, and ensure any
related uses (e.g., backtrace_symbols(trace.data(), trace_size)) remain
consistent with trace_size derived from that call; update identifiers in
get_backtrace() (trace, trace_size, backtrace call) accordingly.
ℹ️ Review info
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
📒 Files selected for processing (2)
.clang-tidysrc/common/assert.cpp
💤 Files with no reviewable changes (1)
- .clang-tidy
b6e97a4 to
1bec453
Compare
cvvergara
left a comment
There was a problem hiding this comment.
Looks fine, I am approving pending the actions I just triggered
This PR adds
cppcoreguidelines-avoid-c-arraysin.clang-tidy.Enabling this check resulted in a single warning where the c array was replaced with
std::array.Summary by CodeRabbit
Refactor
Chores